Loading libraries

library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(magrittr)
library(ggplot2)
Sys.setenv(MAPBOX_TOKEN = 11122223333444) #presevents the mapbox token error
data = read.csv('owid-covid-data.csv')
head(data)
##   iso_code continent    location       date total_cases new_cases
## 1      AFG      Asia Afghanistan 2020-02-24           5         5
## 2      AFG      Asia Afghanistan 2020-02-25           5         0
## 3      AFG      Asia Afghanistan 2020-02-26           5         0
## 4      AFG      Asia Afghanistan 2020-02-27           5         0
## 5      AFG      Asia Afghanistan 2020-02-28           5         0
## 6      AFG      Asia Afghanistan 2020-02-29           5         0
##   new_cases_smoothed total_deaths new_deaths new_deaths_smoothed
## 1                 NA           NA         NA                  NA
## 2                 NA           NA         NA                  NA
## 3                 NA           NA         NA                  NA
## 4                 NA           NA         NA                  NA
## 5                 NA           NA         NA                  NA
## 6              0.714           NA         NA                  NA
##   total_cases_per_million new_cases_per_million new_cases_smoothed_per_million
## 1                   0.122                 0.122                             NA
## 2                   0.122                 0.000                             NA
## 3                   0.122                 0.000                             NA
## 4                   0.122                 0.000                             NA
## 5                   0.122                 0.000                             NA
## 6                   0.122                 0.000                          0.017
##   total_deaths_per_million new_deaths_per_million
## 1                       NA                     NA
## 2                       NA                     NA
## 3                       NA                     NA
## 4                       NA                     NA
## 5                       NA                     NA
## 6                       NA                     NA
##   new_deaths_smoothed_per_million reproduction_rate icu_patients
## 1                              NA                NA           NA
## 2                              NA                NA           NA
## 3                              NA                NA           NA
## 4                              NA                NA           NA
## 5                              NA                NA           NA
## 6                              NA                NA           NA
##   icu_patients_per_million hosp_patients hosp_patients_per_million
## 1                       NA            NA                        NA
## 2                       NA            NA                        NA
## 3                       NA            NA                        NA
## 4                       NA            NA                        NA
## 5                       NA            NA                        NA
## 6                       NA            NA                        NA
##   weekly_icu_admissions weekly_icu_admissions_per_million
## 1                    NA                                NA
## 2                    NA                                NA
## 3                    NA                                NA
## 4                    NA                                NA
## 5                    NA                                NA
## 6                    NA                                NA
##   weekly_hosp_admissions weekly_hosp_admissions_per_million total_tests
## 1                     NA                                 NA          NA
## 2                     NA                                 NA          NA
## 3                     NA                                 NA          NA
## 4                     NA                                 NA          NA
## 5                     NA                                 NA          NA
## 6                     NA                                 NA          NA
##   new_tests total_tests_per_thousand new_tests_per_thousand new_tests_smoothed
## 1        NA                       NA                     NA                 NA
## 2        NA                       NA                     NA                 NA
## 3        NA                       NA                     NA                 NA
## 4        NA                       NA                     NA                 NA
## 5        NA                       NA                     NA                 NA
## 6        NA                       NA                     NA                 NA
##   new_tests_smoothed_per_thousand positive_rate tests_per_case tests_units
## 1                              NA            NA             NA            
## 2                              NA            NA             NA            
## 3                              NA            NA             NA            
## 4                              NA            NA             NA            
## 5                              NA            NA             NA            
## 6                              NA            NA             NA            
##   total_vaccinations people_vaccinated people_fully_vaccinated total_boosters
## 1                 NA                NA                      NA             NA
## 2                 NA                NA                      NA             NA
## 3                 NA                NA                      NA             NA
## 4                 NA                NA                      NA             NA
## 5                 NA                NA                      NA             NA
## 6                 NA                NA                      NA             NA
##   new_vaccinations new_vaccinations_smoothed total_vaccinations_per_hundred
## 1               NA                        NA                             NA
## 2               NA                        NA                             NA
## 3               NA                        NA                             NA
## 4               NA                        NA                             NA
## 5               NA                        NA                             NA
## 6               NA                        NA                             NA
##   people_vaccinated_per_hundred people_fully_vaccinated_per_hundred
## 1                            NA                                  NA
## 2                            NA                                  NA
## 3                            NA                                  NA
## 4                            NA                                  NA
## 5                            NA                                  NA
## 6                            NA                                  NA
##   total_boosters_per_hundred new_vaccinations_smoothed_per_million
## 1                         NA                                    NA
## 2                         NA                                    NA
## 3                         NA                                    NA
## 4                         NA                                    NA
## 5                         NA                                    NA
## 6                         NA                                    NA
##   new_people_vaccinated_smoothed new_people_vaccinated_smoothed_per_hundred
## 1                             NA                                         NA
## 2                             NA                                         NA
## 3                             NA                                         NA
## 4                             NA                                         NA
## 5                             NA                                         NA
## 6                             NA                                         NA
##   stringency_index population_density median_age aged_65_older aged_70_older
## 1             8.33             54.422       18.6         2.581         1.337
## 2             8.33             54.422       18.6         2.581         1.337
## 3             8.33             54.422       18.6         2.581         1.337
## 4             8.33             54.422       18.6         2.581         1.337
## 5             8.33             54.422       18.6         2.581         1.337
## 6             8.33             54.422       18.6         2.581         1.337
##   gdp_per_capita extreme_poverty cardiovasc_death_rate diabetes_prevalence
## 1       1803.987              NA               597.029                9.59
## 2       1803.987              NA               597.029                9.59
## 3       1803.987              NA               597.029                9.59
## 4       1803.987              NA               597.029                9.59
## 5       1803.987              NA               597.029                9.59
## 6       1803.987              NA               597.029                9.59
##   female_smokers male_smokers handwashing_facilities hospital_beds_per_thousand
## 1             NA           NA                 37.746                        0.5
## 2             NA           NA                 37.746                        0.5
## 3             NA           NA                 37.746                        0.5
## 4             NA           NA                 37.746                        0.5
## 5             NA           NA                 37.746                        0.5
## 6             NA           NA                 37.746                        0.5
##   life_expectancy human_development_index population
## 1           64.83                   0.511   41128772
## 2           64.83                   0.511   41128772
## 3           64.83                   0.511   41128772
## 4           64.83                   0.511   41128772
## 5           64.83                   0.511   41128772
## 6           64.83                   0.511   41128772
##   excess_mortality_cumulative_absolute excess_mortality_cumulative
## 1                                   NA                          NA
## 2                                   NA                          NA
## 3                                   NA                          NA
## 4                                   NA                          NA
## 5                                   NA                          NA
## 6                                   NA                          NA
##   excess_mortality excess_mortality_cumulative_per_million
## 1               NA                                      NA
## 2               NA                                      NA
## 3               NA                                      NA
## 4               NA                                      NA
## 5               NA                                      NA
## 6               NA                                      NA

Data preprocessing, checking on the column names and determine the important ones to help me in achieving the objectives, checking for null/NAN values.

Write the column names to a text file for my reference in the analysis

columns <- colnames(data)
file_columns<-file("columns.txt")
writeLines(c(columns), file_columns)
close(file_columns) #close the file

Check columns with the null values

#which(is.na(data))
cols_with_na <- which(apply(data, 2, function(x) any(is.na(x))))
#colnames(data)[cols_with_na] #this indicates that atleast there are missing records in one or more rows in each feature included in the dataset.Except iso_code, continent, location and date
colSums(is.na(data))
##                                   iso_code 
##                                          0 
##                                  continent 
##                                          0 
##                                   location 
##                                          0 
##                                       date 
##                                          0 
##                                total_cases 
##                                      14149 
##                                  new_cases 
##                                      14421 
##                         new_cases_smoothed 
##                                      15625 
##                               total_deaths 
##                                      33662 
##                                 new_deaths 
##                                      33752 
##                        new_deaths_smoothed 
##                                      34938 
##                    total_cases_per_million 
##                                      15218 
##                      new_cases_per_million 
##                                      15490 
##             new_cases_smoothed_per_million 
##                                      16689 
##                   total_deaths_per_million 
##                                      34718 
##                     new_deaths_per_million 
##                                      34808 
##            new_deaths_smoothed_per_million 
##                                      35989 
##                          reproduction_rate 
##                                      64271 
##                               icu_patients 
##                                     215655 
##                   icu_patients_per_million 
##                                     215655 
##                              hosp_patients 
##                                     212715 
##                  hosp_patients_per_million 
##                                     212715 
##                      weekly_icu_admissions 
##                                     240723 
##          weekly_icu_admissions_per_million 
##                                     240723 
##                     weekly_hosp_admissions 
##                                     229144 
##         weekly_hosp_admissions_per_million 
##                                     229144 
##                                total_tests 
##                                     169701 
##                                  new_tests 
##                                     173685 
##                   total_tests_per_thousand 
##                                     169701 
##                     new_tests_per_thousand 
##                                     173685 
##                         new_tests_smoothed 
##                                     145123 
##            new_tests_smoothed_per_thousand 
##                                     145123 
##                              positive_rate 
##                                     153161 
##                             tests_per_case 
##                                     154740 
##                                tests_units 
##                                          0 
##                         total_vaccinations 
##                                     178686 
##                          people_vaccinated 
##                                     181756 
##                    people_fully_vaccinated 
##                                     184443 
##                             total_boosters 
##                                     209724 
##                           new_vaccinations 
##                                     190685 
##                  new_vaccinations_smoothed 
##                                     101028 
##             total_vaccinations_per_hundred 
##                                     178686 
##              people_vaccinated_per_hundred 
##                                     181756 
##        people_fully_vaccinated_per_hundred 
##                                     184443 
##                 total_boosters_per_hundred 
##                                     209724 
##      new_vaccinations_smoothed_per_million 
##                                     101028 
##             new_people_vaccinated_smoothed 
##                                     101302 
## new_people_vaccinated_smoothed_per_hundred 
##                                     101302 
##                           stringency_index 
##                                      65926 
##                         population_density 
##                                      32074 
##                                 median_age 
##                                      48362 
##                              aged_65_older 
##                                      50479 
##                              aged_70_older 
##                                      49412 
##                             gdp_per_capita 
##                                      48769 
##                            extreme_poverty 
##                                     118578 
##                      cardiovasc_death_rate 
##                                      48943 
##                        diabetes_prevalence 
##                                      38470 
##                             female_smokers 
##                                      97300 
##                               male_smokers 
##                                      99377 
##                     handwashing_facilities 
##                                     150434 
##                 hospital_beds_per_thousand 
##                                      70706 
##                            life_expectancy 
##                                      20565 
##                    human_development_index 
##                                      53536 
##                                 population 
##                                       1069 
##       excess_mortality_cumulative_absolute 
##                                     240847 
##                excess_mortality_cumulative 
##                                     240847 
##                           excess_mortality 
##                                     240808 
##    excess_mortality_cumulative_per_million 
##                                     240847

Visualizing the total reported cases since the start of the pandemic

df <- data
# show difference between paths and lines
p <- df %>%
  arrange(total_cases) %>%
  plot_ly(x = ~date, y = ~total_cases) %>% 
    add_markers(alpha = 0.2, name = "alpha")
add_lines(p)
## Warning: Ignoring 14149 observations

Considering the new tests

p <- df %>%
  arrange(new_tests) %>%
  plot_ly(x = ~date, y = ~new_tests) %>% 
add_lines(p)

A notable issue for the visualization is that although there were millions of reported cases, the number of new tests was relatively low, implying that not all countries could have accounted to new tests but had highest number of reported cases.

To confirm the validity of this conclusion, the following visualization digs deep into highlighting the top countries with most cases and most new tests

top10 <- df %>%
  group_by(continent) %>%
  summarise(m = mean(total_cases, na.rm = TRUE)) %>%
  arrange(desc(m)) %>%
  top_n(10)
## Selecting by m
tx10 <- semi_join(df, top10, by = "continent")

plot_ly(tx10, x = ~date, y = ~median) %>%
  add_lines(linetype = ~location)
## Warning: plotly.js only supports 6 different linetypes
## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'

## Warning: The following are not valid linetype codes:
## 'NA'
## Valid linetypes include:
## 'solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'
#use the new datasets with fixed latitudes for better map visualization.
new_data <- read.csv("coronavirus.csv")
save(new_data, file = "corona.RData")
head(new_data)
##         date province country     lat      long      type cases   uid iso2 iso3
## 1 2020-01-22  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
## 2 2020-01-23  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
## 3 2020-01-24  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
## 4 2020-01-25  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
## 5 2020-01-26  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
## 6 2020-01-27  Alberta  Canada 53.9333 -116.5765 confirmed     0 12401   CA  CAN
##   code3    combined_key population continent_name continent_code
## 1   124 Alberta, Canada    4413146  North America           <NA>
## 2   124 Alberta, Canada    4413146  North America           <NA>
## 3   124 Alberta, Canada    4413146  North America           <NA>
## 4   124 Alberta, Canada    4413146  North America           <NA>
## 5   124 Alberta, Canada    4413146  North America           <NA>
## 6   124 Alberta, Canada    4413146  North America           <NA>
#get the leading countries in terms of the number of cases confirmed

filtered_df <- new_data %>% 
  filter(type == "confirmed") %>%
  group_by(country) %>%
  summarise(sum_Cases = sum(cases)) %>%
  arrange(-sum_Cases)%>%
  top_n(10) #order the total in ascending order
## Selecting by sum_Cases
plt <- ggplot(filtered_df, aes(x = country, y=sum_Cases)) + geom_bar(stat="identity", fill="steelblue")+
  theme_minimal()
ggplotly(plt)